    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 
    <%@taglib prefix="s" uri="/struts-tags"%> 
    <% 
        String path = request.getContextPath(); 
        String basePath = request.getScheme() + "://" 
                + request.getServerName() + ":" + request.getServerPort() 
                + path + "/"; 
    %> 
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
        <head> 
            <base href="<%=basePath%>"> 
            <title>导航树页面</title> 
            <link rel="stylesheet" href="<%=path%>/css/zTreeStyle/zTreeStyle.css"> 
            <script type="text/javascript" 
                src="<%=path%>/js/jquery-1.4.4.min.js"></script> 
            <script type="text/javascript" 
                src="<%=path%>/js/jquery.ztree.core-3.4.js"></script> 
            <script type="text/javascript" 
                src="<%=path%>/js/jquery.ztree.excheck-3.4.js"></script> 
            <script type="text/javascript" 
                src="<%=path%>/js/jquery.ztree.exedit-3.4.js"></script> 
     
     
            <meta http-equiv="pragma" content="no-cache"> 
            <meta http-equiv="cache-control" content="no-cache"> 
            <meta http-equiv="expires" content="0"> 
            <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> 
            <meta http-equiv="description" content="This is my page"> 
     		<script type="text/javascript">
			var demoTree;
			var setting={
		         async: {
					enable: true,
					url:"doLoadNode",
					autoParam:["id"]
				},
				check:{				
					chkStyle:{ "Y": "ps", "N": "ps" },
					chkStyle: "checkbox",
					enable:true
				},
				data: { 
					simpleData: {
						enable : true,
						idKey : "id",
						pIdKey : "pid",
						rootPId : -1
					}
				},
				view: {
	                showLine: true,
	                dblClickExpand :false
            	},
            	callback: {
					beforeExpand: true
				}
            };
            //var zNodes =[];
        	var zTreeObj;//树对象 
        	function createTree(){ 
	            $.ajax({ 
	                url: 'doLoadNode', 
	                type:'POST', 
	                dataType:'text', 
	                ContentType:'application/json; charset=utf-8', 
	                success:function(data){ 
	                alert(data)
	                    var zNodes = data; 
	                    	zTree1=$.fn.zTree.init($('#doLoadNode2'),setting,eval('(' + data + ')'));
	                    	//alert(zNodes); 
	                }, 
	                error:function(msg){ 
	                    alert('指标树加载异常！'); 
	                } 
	           	}); 
        	} 
			$(document).ready(function(){
          		//createTree();
	            //创建对象
	            //demoTree = $.fn.zTree.init($("#doLoadNode2"), setting,zNodes);
	            demoTree = $.fn.zTree.init($("#doLoadNode2"), setting);
					            
        	});
        
    </script>
	</head>

	<body>
		
		<br/>
		<div id="demo">
			<ul
				style="margin-bottom: 2px; margin-left: 5px; font: normal 14px Verdana;">
			</ul>
			<ul id="doLoadNode2" class="ztree"></ul>
			
		</div>
	</body>
</html>